import request from '@/utils/request.js'

//将针对Admin的所有请求封装到一个对象里面
const categoryApi = {
	selectCategoryTree() {
		return request.get('/product/category/selectCategoryTree')
	},
	selectByParentId(id){
		return request.get(`/product/category/selectByParentId/${id}`)
	},
	selectById(id) {
		return request.get(`/product/category/selectById/${id}`)
	},
	deleteById(id) {
		return request.delete(`/product/category/deleteById/${id}`)
	},
	update(category) {
		return request.put('/product/category/update', category)
	},
	add(category) {
		return request.post('/product/category/add', category)
	}
}

export default categoryApi